<!DOCTYPE html>
<html>
<head>
    <title>DOM Event Object Example</title>
</head>
<body>
    <input type="button" value="Click Me" id="myBtn" />
    <script type="text/javascript">
        var btn = document.getElementById("myBtn");
        btn.onclick = function(event){
            alert(event.eventPhase);   //2
        };
        
        document.body.addEventListener("click", function(event){
            alert(event.eventPhase);   //1
        }, true);
        
        document.body.onclick = function(event){
            alert(event.eventPhase);   //3
        };

    </script>
</body>
</html>
